<!DOCTYPE html>
<meta charset="UTF-8">
<div style="padding: 10px; height: 390px; width: 700px;">
	<table id="complextoolbar_grid" data-type="grid" title="grid列表中的复杂工具栏" style="width: 700px; height: 330px"
		data-defs="rownumbers:true,singleSelect:true,border:true,pageSize:20,pagination:true,
		method:'get',url: 'demo/testdata/grid_data1.json',fit:true,fitColumns:true,
		onLoadSuccess:setPagerBt_complextoolbar,
		toolbar:'#complextoolbar_tb'">
		<thead>
			<tr>
				<th data-defs="field:'itemid',width:80,checkbox:true">ID</th>
				<th data-defs="field:'productid',width:200">产品名称</th>
				<th data-defs="field:'listprice',width:80,align:'right'">成本</th>
				<th data-defs="field:'unitcost',width:80,align:'right'">单价</th>
				<th data-defs="field:'attr1',width:100">属性</th>
				<th data-defs="field:'status',width:60,align:'center'">状态</th>
			</tr>
		</thead>
	</table>
</div>
<div id="complextoolbar_tb" style="padding: 0px; height: auto">
	<div>
		<a href="javascript:void(0)" data-type="button" data-defs="iconCls:'icon-add',plain:true" onclick="add()">新增</a>
		<a href="javascript:void(0)" data-type="button" data-defs="iconCls:'icon-edit',plain:true" onclick="edit()">编辑</a>
		<a href="javascript:void(0)" data-type="button" data-defs="iconCls:'icon-cancel',plain:true" onclick="remove()">删除</a>
		<a href="javascript:void(0)" data-type="button" data-defs="iconCls:'icon-search',plain:true" onclick="search()">搜索</a>
	</div>
</div>
<script type="text/javascript">
	function setPagerBt_complextoolbar() {
	    var pager = $('#complextoolbar_grid').grid('getPager');
	    pager.pagination({
		    buttons : [ {
		        iconCls : 'icon-search',
		        pagerbtn : true,
		        handler : function() {
			        alert('search');
		        }
		    }, {
		        iconCls : 'icon-add',
		        pagerbtn : true,
		        handler : function() {
			        alert('add');
		        }
		    }, {
		        iconCls : 'icon-edit',
		        pagerbtn : true,
		        handler : function() {
			        alert('edit');
		        }
		    } ]
	    });
    }
</script>
